package com.example;

import com.example.registry.ServiceRegistry;
import com.example.service.UserServiceImpl;
import com.example.zkconnect.ZkConnection;

/**
 * @Description
 * @Author 26233
 * @Create 2021-11-02 16:32:54
 */

public class Main {

    public static void main(String[] args) {

        YamlParser yamlParser = new YamlParser("/config.yaml");
        String zkAddress = yamlParser.getZkAddress();
        String serverHost = yamlParser.getServerHost();
        int serverPort = yamlParser.getServerPort();

        ZkConnection zkConnection = new ZkConnection(zkAddress, 60);
        ServiceRegistry serviceRegistry = new ServiceRegistry(zkConnection, serverHost, serverPort);

        serviceRegistry.registry(UserServiceImpl.class, "userService");

    }

}
